package LeetCode刷题;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2021-12-28 09:39
 * @description: Functions of this class is
 * 官方题解：
 * ！！！关键就是每次都移动柱比较矮的那一个，这样就可以实现尽可能的使左右两边都高
 *public class Solution {
 *     public int maxArea(int[] height) {
 *         int l = 0, r = height.length - 1;
 *         int ans = 0;
 *         while (l < r) {
 *             int area = Math.min(height[l], height[r]) * (r - l);
 *             ans = Math.max(ans, area);
 *             if (height[l] <= height[r]) {
 *                 ++l;
 *             }
 *             else {
 *                 --r;
 *             }
 *         }
 *         return ans;
 *     }
 * }
 **/
public class NoNo盛最多水的容器 {
    public static void main(String[] args) {

    }

}